home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr10 / snr503.zip / EVERY5.S < prev    next >
Text File  |  1993-05-30  |  921b  |  18 lines

  1. \  EVERY5.S
  2. \  Here's an example of how to use flags to do some rudimentary
  3. \  counting. This table will insert a "peek-a-boo" message in the
  4. \  output file every five lines.
  5.  
  6. \  Note that this concept is not limited to counting carriage returns;
  7. \  you can count any character string using this method (such as tabs).
  8. \  You can get real fancy by combining the 16 available flags to count
  9. \  higher than 16. For example, by chaining flags in a binary progression,
  10. \  you can use 6 flags to count up to 64, 7 flags to count up to 128, etc.
  11. \  That would get somewhat complex, though.
  12.  
  13. \0d\0a*00=\0d\0a*11     \ CRLF and flag 0 OFF, turn flag 1 ON
  14. \0d\0a*11=\0d\0a*21     \ CRLF and flag 1 ON, turn flag 2 ON
  15. \0d\0a*21=\0d\0a*31     \ CRLF and flag 2 ON, turn flag 3 ON
  16. \0d\0a*31=\0d\0a*41     \ CRLF and flag 3 ON, turn flag 4 ON
  17. \0d\0a*41=\0d\0a<PEEK-A-BOO!>\0d\0a*00*10*20*30*40   \ turn all flags OFF
  18.